﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;

namespace WebApplication.Admins.Controls
{
    public partial class UC_Tinh_ThanhPho : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
                Display();
        }
        public void Display()
        {
            repTinhTP.DataSource = Tinh_ThanhPhoBLL.LayTatCa();
            repTinhTP.DataBind();
        }
        protected void btnXoa_Click(object sender, EventArgs e)
        {
            string Id = Request.Form["Id"] ?? "";
            if (Id != "")
            {
                foreach (string id in Id.Split(','))
                    Tinh_ThanhPhoBLL.Xoa(id);
                Display();
            }
        }

    }
}